package com.wlient.basic.Thread.test;

import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.springframework.integration.json.JsonPathUtils;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.IntConsumer;
import java.util.stream.Collectors;

class FizzBuzz {
    public static void main(String[] args) {
        int[] arr = {2,3,4,7,8,9};
        //List list = Arrays.asList(arr);
        // list.add(22);
        //会报错,Exception in thread "main" java.lang.UnsupportedOperationException
        //Arrays.asList(strArray)返回值是java.util.Arrays类中一个私有静态内部类java.util.Arrays.ArrayList，
        //它并非java.util.ArrayList类。java.util.Arrays.ArrayList类具有 set()，get()，contains()等方法
        // 但是不具有添加add()或删除remove()方法,所以调用add()方法会报错。

//        ArrayList list = new ArrayList(Arrays.asList(arr)) ;
//        list.add(22);
//        list.stream().forEach(System.out::print);

        List list = new ArrayList(arr.length);
        Collections.addAll(list,arr);
        System.out.println(list);
    }

}